<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function numberTest() {
	var num1 = window.parseInt("10");
	var num2 = parseInt("20");//window 생략 가능
	alert(num1 + num2);
	alert("10"+"20");
	var num3 = window.parseFloat("30.2");
	var num4 = window.parseFloat("20.7");
	alert(num3+num4);
	
}
function isNaNTest(str){
	var flag = window.isNaN(str);
	//str이 숫자 형태 문자열인지 체크 : true - 숫자형태가 아닐때 (NaN :Not a Number)
	alert(flag);
	if(!flag){}
	alert(window.parseInt(str));
} else {
	alert("숫자가 아닙니다.");
}
}

</script>
</head>
<body>
	<button onClick="numberTest();">numberTest()</button>
	<button onClick="isNaNTest('200')">isNaNTest()</button>
	<button onClick="isNaNTest('aaa)">isNaNTest()</button>
	<button onClick="window.close();">닫기</button>
</body>
</html>